package com.googlecode.imanager.client.util;

import java.io.Serializable;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public class Point implements Serializable {

    private static final long serialVersionUID = 1L;

    private int x;
    private int y;
    
    public Point(){
    }
    
    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (obj == this){
            return true;
        }
        if (obj instanceof Point){
            Point r = (Point) obj;
            return (r.x == x)
                && (r.y == y);
        }
        return false;
    }

    @Override
    public int hashCode() {
        return x ^ (y << 16);
    }

    @Override
    public String toString() {
        return "Point[x=" + x + ", y=" + y + "]";
    }
    
}
